package nongchang.kuaijiecaifu.com.ncapp_android.ui;

import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import ezy.lite.util.FragmentUtil;
import ezy.lite.util.Param;
import ezy.widget.adapter.TabsAdapter;
import nongchang.kuaijiecaifu.com.ncapp_android.Const;
import nongchang.kuaijiecaifu.com.ncapp_android.R;
import nongchang.kuaijiecaifu.com.ncapp_android.common.activity.BaseActivity;
import nongchang.kuaijiecaifu.com.ncapp_android.retrofit.good.IntegralDetail;
import nongchang.kuaijiecaifu.com.ncapp_android.ui.adapter.IntegralDetailListAdapter;
import nongchang.kuaijiecaifu.com.ncapp_android.ui.fragment.MyIntegralFragment;
import nongchang.kuaijiecaifu.com.ncapp_android.ui.fragment.MyLaiseeFragment;
import nongchang.kuaijiecaifu.com.ncapp_android.ui.lifeshopfragment.LifeShopDetailFragment;
import nongchang.kuaijiecaifu.com.ncapp_android.ui.lifeshopfragment.LifeShopJoinFragment;
import nongchang.kuaijiecaifu.com.ncapp_android.ui.lifeshopfragment.LifeShopRaffleFragment;

public class IntegralDetailActivity extends BaseActivity {
    @BindView(R.id.types)
    TabLayout mTabs;
    @BindView(R.id.pager)
    ViewPager mViewPager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_integral_detail);
        ButterKnife.bind(this);
        Fragment fragments[]={new MyIntegralFragment(),new MyIntegralFragment(),new MyIntegralFragment()};
        mViewPager.setAdapter(new TabsAdapter(getSupportFragmentManager(), fragments));
        mTabs.addTab(mTabs.newTab().setText("全部"), true);
        mTabs.addTab(mTabs.newTab().setText("收入"));
        mTabs.addTab(mTabs.newTab().setText("支出"));
        mTabs.setOnTabSelectedListener(onTabSelectedListener);
        mViewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(mTabs));
    }
    TabLayout.OnTabSelectedListener onTabSelectedListener = new TabLayout.OnTabSelectedListener() {
        @Override
        public void onTabSelected(TabLayout.Tab tab) {
            mViewPager.setCurrentItem(tab.getPosition());
        }

        @Override
        public void onTabUnselected(TabLayout.Tab tab) {

        }

        @Override
        public void onTabReselected(TabLayout.Tab tab) {

        }
    };
    @OnClick({R.id.btn_back})
    void onClick(View view){
        switch (view.getId()){
            case R.id.btn_back:
                finish();
                break;
        }
    }


}
